package com.md.service.impl;

import com.md.dao.impl.UserDao;
import com.md.entity.User;
import com.md.service.UserService;

// 具体请的厨师，定一个具体可以执行厨师岗位职责的人
public class UserServiceImpl  implements UserService {

    // 厨师做菜，要依赖采购员采购的材料，所以把采购员注入起来
    private UserDao userDao;

    @Override
    public Boolean removeUserById(int id){
        int i = userDao.deleteUserById(id);
        return i>0;// 根据受影响行业判断成功与否
    }

    @Override
    public User getUserById(int id){
        User user = userDao.selectUserById(id);
        user.setUsername("张三");
        return user;
    }

}
